import Vue from 'vue'
import Router from 'vue-router'
// 登录页面
import Login from '@/components/login/login'
// 主页面
import Index from '@/components/common/common'
//用户信息页
import MemberIndex from '@/components/member/index'
import MemberMessage from '@/components/member/memberMessage'
//业绩管理
import BonusManage from '@/components/achievement/bonusManage'
import AchievementSearch from '@/components/achievement/search'
import AchievementIndex from '@/components/achievement/index'
//服务中心综合额度
import LimitSearch from "@/components/limit/search"
// 订单管理
import OrderSearch from "@/components/order/search"
import OrderList from "@/components/order/list"
// 普通订单
import Search1 from "@/components/order/search1"
// 退货订单
import Search2 from "@/components/order/search2"
// 补单订单
import Search3 from "@/components/order/search3"
// 调差单订单
import Search4 from "@/components/order/search4"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:"/index/memberIndex",
      name: 'Login',
      component: Login,
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children:[
        // 会员信息
        {
          path: 'memberIndex',
          name: 'MemberIndex',
          component: MemberIndex,
        },
        {
          path: 'memberMessage',
          name: 'MemberMessage',
          component: MemberMessage,
        },
        //业绩管理
        {
          // 业绩查询搜索页
          path: 'achievementSearch',
          name: 'AchievementSearch',
          component: AchievementSearch,
        },
        {
          // 业绩查询详细页
          path: 'achievementIndex',
          name: 'AchievementIndex',
          component: AchievementIndex,
        },
        {
          // 奖金管理页
          path: 'bonusManage',
          name: 'BonusManage',
          component: BonusManage,
        },
        //额度管理
        {
          // 服务中心综合额度
          path: 'limitSearch',
          name: 'LimitSearch',
          component: LimitSearch,
        },
        // 订单管理
        {
          // 订单查询
          path: 'search1',
          name: 'Search1',
          component: Search1,
        },
        {
          // 退货查询
          path: 'search2',
          name: 'Search2',
          component: Search2,
        },
        {
          // 补单查询
          path: 'search3',
          name: 'Search3',
          component: Search3,
        },
        {
          // 调差单查询
          path: 'search4',
          name: 'Search4',
          component: Search4,
        },
      ]
    },
  ]
})
